package com.online.teaching.module.student.takes.service.impl;

import com.online.teaching.dao.AnswerMapper;
import com.online.teaching.dao.HomeworkMapper;
import com.online.teaching.dao.TakesMapper;
import com.online.teaching.dao.TeachesMapper;
import com.online.teaching.module.student.takes.domain.vo.GetHomeWorkListVO;
import com.online.teaching.module.student.takes.domain.vo.GetTakesListVO;
import com.online.teaching.module.student.takes.service.StudentTakesService;
import com.online.teaching.pojo.Answer;
import com.online.teaching.pojo.Homework;
import com.online.teaching.pojo.Teaches;
import com.online.teaching.utils.SmartBeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : StudentBlogServiceImpl  //类名
 * @Description :   //描述
 * @Author : YG  //作者
 * @Date: 2020-11-04 13:21  //时间
 */
@Service
public class StudentTakesServiceImpl implements StudentTakesService {

    @Autowired
    private TakesMapper takesMapper;

    @Autowired
    private TeachesMapper teachesMapper;



    @Override
    public List<GetTakesListVO> getTakesList(Integer studentId) {

        List<Integer> teachesStudentList = takesMapper.getTeachesStudentList(studentId);
        List<Teaches> teaches = teachesMapper.selectByIdList(teachesStudentList);
        List<GetTakesListVO> getTakesListVOS = SmartBeanUtil.copyList(teachesStudentList, GetTakesListVO.class);
        return getTakesListVOS;
    }
}
